package com.ssy.lingxi.platform.template.service.controller.mobile;

import com.ssy.lingxi.common.controller.BaseController;
import com.ssy.lingxi.common.response.Wrapper;
import com.ssy.lingxi.platform.template.service.entity.adorn.AppAdorn;
import com.ssy.lingxi.platform.template.service.model.dto.common.MemberIdRoleIdShopIdDTO;
import com.ssy.lingxi.platform.template.service.model.dto.common.SiteIdAndShopIdDTO;
import com.ssy.lingxi.platform.template.service.service.mobile.PageTemplateMobileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * @menu mobile - 页面模板
 * @author fhj
 * @version 2.0.0
 * @date 2020/12/11
 */
@Api(tags = "mobile - 页面模板")
@RestController
@RequestMapping("/template/mobile/pageTemplateMobile")
public class PageTemplateMobileController extends BaseController {

    @Resource
    private PageTemplateMobileService pageTemplateMobileService;

    @ApiOperation(value = "获取APP企业商城模板B端装修")
    @GetMapping("/findAppEnterpriseTemplateB")
    public Wrapper<AppAdorn> findAppEnterpriseTemplateB(@Valid SiteIdAndShopIdDTO dto) {
        return pageTemplateMobileService.findAppEnterpriseTemplateB(dto);
    }

    @ApiOperation(value = "获取APP企业商城模板C端装修")
    @GetMapping("/findAppEnterpriseTemplateC")
    public Wrapper<AppAdorn> findAppEnterpriseTemplateC(@Valid SiteIdAndShopIdDTO dto) {
        return pageTemplateMobileService.findAppEnterpriseTemplateC(dto);
    }

    @ApiOperation(value = "获取APP自营商城模板装修")
    @GetMapping("/findAppSelfTemplate")
    public Wrapper<AppAdorn> findAppSelfTemplate(@Valid MemberIdRoleIdShopIdDTO dto) {
        return pageTemplateMobileService.findAppSelfTemplate(dto);
    }

    @ApiOperation(value = "获取APP渠道商城模板装修")
    @GetMapping("/findAppChannelTemplate")
    public Wrapper<AppAdorn> findAppChannelTemplate(@Valid MemberIdRoleIdShopIdDTO dto) {
        return pageTemplateMobileService.findAppChannelTemplate(dto);
    }
}
